/*
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   
#
# 
# Copyright (c) 2015-2020, kunluntech (Beijing) Co., Ltd.. All   
# Rights Reserved.                                                               
# 
# You may not reproduce, distribute, publish, display, perform, modify, adapt,   
# transmit, broadcast, present, recite, release, license or otherwise exploit    
# any part of this publication in any form, by any means, without the prior      
# written permission of kunluntech (Beijing) Co., Ltd..                       
#
#
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   
*/

#include <CLI/CLI.hpp>
//#include <iostream>
//#include <memory>
#include "disk-prediction.hpp"
#if __WORDSIZE == 64
#define U64_    "%lu"
#else
#define U64_    "%llu"
#endif

int main(int argc, char** argv)
{
    uint64_t interval = default_interval;
    std::string sampleSmart;

    CLI::App app{"Disk Failure Prediction"};
    app.add_option("-t,--time-interval", interval, "The interval of timer(s)");

    CLI11_PARSE(app, argc, argv);
   
    fprintf(stderr,"[disk-predict] set timer interval=" U64_ "(s)\n", interval);
    interval = interval * 1000000;   //conver to us

    PredictionLoop loop(sdbusplus::bus::new_default(), DFP_BUSNAME_PREFIX, DFP_DBUS_ROOT, interval);
    loop.run();
    return 0;
}
